package com.irdstudio.efp.nls.service.impl;

import com.irdstudio.basic.framework.core.base.FrameworkService;
import com.irdstudio.efp.nls.service.dao.PsdSendTaxMessageRecordDao;
import com.irdstudio.efp.nls.service.domain.PsdSendTaxMessageRecord;
import com.irdstudio.efp.nls.service.facade.PsdSendTaxMessageRecordService;
import com.irdstudio.efp.nls.service.vo.PsdSendTaxMessageRecordVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * Service Impl: 服务实现
 *
 * @author gcb
 * @date 2020-09-04
 */
@Service("psdSendTaxMessageRecordService")
public class PsdSendTaxMessageRecordServiceImpl implements PsdSendTaxMessageRecordService, FrameworkService {

    private static Logger logger = LoggerFactory.getLogger(PsdSendTaxMessageRecordServiceImpl.class);

    @Autowired
    private PsdSendTaxMessageRecordDao psdSendTaxMessageRecordDao;

    /**
     * 新增数据
     *
     * @param psdSendTaxMessageRecordVo
     * @return
     */
    @Override
    public int insert(PsdSendTaxMessageRecordVO psdSendTaxMessageRecordVo) throws Exception {
        return psdSendTaxMessageRecordDao.insert(beanCopy(psdSendTaxMessageRecordVo, new PsdSendTaxMessageRecord()));
    }

    /**
     * 根据主键删除信息
     *
     * @param psdSendTaxMessageRecordVo
     * @return
     */
    @Override
    public int deleteByPk(PsdSendTaxMessageRecordVO psdSendTaxMessageRecordVo) throws Exception {
        return psdSendTaxMessageRecordDao.deleteByPk(beanCopy(psdSendTaxMessageRecordVo, new PsdSendTaxMessageRecord()));
    }

    /**
     * 根据主键更新信息
     *
     * @param psdSendTaxMessageRecordVo
     * @return
     */
    @Override
    public int updateByPk(PsdSendTaxMessageRecordVO psdSendTaxMessageRecordVo) throws Exception {
        return psdSendTaxMessageRecordDao.updateByPk(beanCopy(psdSendTaxMessageRecordVo, new PsdSendTaxMessageRecord()));
    }

    /**
     * 根据主键查询详情
     *
     * @param inPsdSendTaxMessageRecordVo
     * @return
     */
    @Override
    public PsdSendTaxMessageRecordVO queryByPk(PsdSendTaxMessageRecordVO inPsdSendTaxMessageRecordVo) throws Exception {
        return beanCopy(psdSendTaxMessageRecordDao.queryByPk(beanCopy(inPsdSendTaxMessageRecordVo, new PsdSendTaxMessageRecord())), new PsdSendTaxMessageRecordVO());
    }
}
